
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class PARTS_SPECSMap : EntityTypeConfiguration<PARTS_SPECS>
    {
        public PARTS_SPECSMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.SUPPLIER_NAME)
                .IsRequired()
                .HasMaxLength(16);

            this.Property(t => t.SPEC_NAME).IsRequired().HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("PARTS_SPECS");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.SUPPLIER_ID).HasColumnName("SUPPLIER_ID");
            this.Property(t => t.SUPPLIER_NAME).HasColumnName("SUPPLIER_NAME");
            this.Property(t => t.SPEC_NAME).HasColumnName("SPEC_NAME");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.PARTS_ID).HasColumnName("PARTS_ID");
            this.Property(t => t.PARTS_NAME).HasColumnName("PARTS_NAME");
        }
    }
}
